package com.neusoft.elmboot.mapper;

import com.neusoft.elmboot.po.WalletTransaction;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface WalletTransactionMapper {
    @Insert("INSERT INTO wallet_transaction (wallet_id, transaction_type, amount, timestamp, order_id) VALUES (#{walletId}, #{transactionType}, #{amount}, #{timestamp}, #{orderId})")
    int insertTransaction(WalletTransaction transaction);

    @Select("SELECT * FROM wallet_transaction WHERE order_id = #{orderId}")
    WalletTransaction getTransactionByOrderId(Integer orderId);
}